import apiClient from './index'; // 假设你使用了一个封装好的axios实例

export const footprintApi = {
  getFootprints: () => apiClient.get('/footprints'),
  addFootprint: (propertyId, data) => apiClient.post(`/footprints/${propertyId}`, data),
  updateFootprint: (propertyId, data) => apiClient.put(`/footprints/${propertyId}`, data),
  deleteFootprint: (propertyId) => apiClient.delete(`/footprints/${propertyId}`),
};


export const footprintAdminApi = {

  getFootprints: (params) => {
    // 注意：这里的URL是 /footprints，而不是 /me/footprints
    return apiClient.get('/footprints', { params });
  },

  updateFootprint: (propertyId, data) => {
    // 注意：这里的URL是 /footprints/:id，而不是 /me/footprints/:id
    return apiClient.put(`/footprints/${propertyId}`, data);
  },

  batchClearNotes: (footprints) => {
    // 这是为批量操作新增的接口
    return apiClient.put('/footprints/batch-clear-notes', { footprints });
  },

  deleteFootprint: (userId, propertyId) => {
    // 调用我们新创建的后端接口
    return apiClient.delete(`/footprints/${userId}/${propertyId}`);
  }

};